<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::any('/t', 'TestController@test');
Route::any('/{path?}/t', 'TestController@test')->where('path', '.+');

Route::group([
    'prefix'    => config('admin.prefix'),
    'as'        => 'admin.',
    'namespace' => 'Admin',
], function () {
    Route::post('auth/login', 'AuthController@login');

    Route::group([
        'middleware' => 'jwt.auth_refresh',
    ], function () {
        Route::post('auth/logout', 'AuthController@logout');
        Route::get('auth/info', 'AuthController@info');
        Route::resource('menus', 'MenuController');
        Route::resource('users', 'UserController');
        Route::resource('perms', 'PermissionController');
        Route::resource('roles', 'RoleController');
    });
});
